package com.chao.wind3j.model.base.pageVo;

import com.github.pagehelper.PageInfo;
import lombok.Data;
import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper = true)
@Data
public class RPage extends BPage {
  private Long total;

  public RPage(Integer pageIndex, Integer pageSize, Long total) {
    this.setPageSize(pageSize);
    this.setPageIndex(pageIndex);
    this.setTotal(total);
  }
  public static<T> RPage buildWithPageInfo(PageInfo<T> pageInfo) {
    return new RPage(pageInfo.getPageNum(), pageInfo.getPageSize(), pageInfo.getTotal());
  }
}
